<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport"
	content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,member-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<!--[if lt IE 9]>
<script type="text/javascript" src="lib/html5.js"></script>
<script type="text/javascript" src="lib/respond.min.js"></script>
<script type="text/javascript" src="lib/PIE_IE678.js"></script>
<![endif]-->
<link href="../../../css/H-ui.min.css" rel="stylesheet" type="text/css" />
<link href="../../../css/H-ui.admin.css" rel="stylesheet"
	type="text/css" />
<link href="../../../lib/icheck/icheck.css" rel="stylesheet"
	type="text/css" />
<link href="../../../lib/Hui-iconfont/1.0.1/iconfont.css"
	rel="stylesheet" type="text/css" />
<link href="../../../login/css/bootstrap.min.css" rel="stylesheet"
	type="text/css" />
<link href="../../../fileInput/css/fileinput.css" rel="stylesheet"
	type="text/css" />
<title>添加用户</title>
</head>
<body>
	<div class="pd-20">
		<form class="form form-horizontal" id="form-member-add">


			<div class="row cl">
				<label class="form-label col-3"><span class="c-red">*
				</span>文件：</label>
				<div class="formControls col-5">
					<input type="file" name="uploadfile" id="uploadfile">
				</div>
				<div class="col-4"></div>
			</div>

		</form>
	</div>
	<script type="text/javascript"
		src="../../../lib/jquery/1.9.1/jquery.min.js"></script>
	<script type="text/javascript"
		src="../../../lib/icheck/jquery.icheck.min.js"></script>
	<script type="text/javascript"
		src="../../../lib/Validform/5.3.2/Validform.min.js"></script>
	<script type="text/javascript" src="../../../lib/layer/1.9.3/layer.js"></script>
	<script type="text/javascript" src="../../../js/H-ui.js"></script>
	<script type="text/javascript" src="../../../js/H-ui.admin.js"></script>
	<script type="text/javascript" src="../../../fileInput/js/fileinput.js"></script>
	<script type="text/javascript"
		src="../../../fileInput/js/locales/zh.js"></script>
	<script type="text/javascript">
				
		$("#uploadfile").fileinput({
		    language: 'zh', //设置语言
		    uploadUrl: "/v1/admin/upload/upload", //上传的地址
		    allowedFileExtensions: ['jpg','png'],//接收的文件后缀
		    uploadAsync: true, //默认异步上传
		    showUpload: true, //是否显示上传按钮
		    showRemove : true, //显示移除按钮
		    showPreview : true, //是否显示预览
		    showCaption: true,//是否显示标题
		    browseClass: "btn btn-success", //按钮样式     
		    dropZoneEnabled: false,//是否显示拖拽区域
		    maxFileCount: 1, //表示允许同时上传的最大文件个数
		    enctype: 'multipart/form-data', 
		    uploadExtraData: function(previewId, index) {   //额外参数的关键点
                var obj = {
					id:GetQueryString("id")
                };
                return obj;
            },
		    validateInitialCount:true
		});
	

		
		// 获取url参数
		function GetQueryString(name) {
			var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
			var r = window.location.search.substr(1).match(reg);
			if (r != null)
				return unescape(r[2]);
			return null;
		}
		
		
		//初始化数据
		function initData() {
			
			var index = layer.load(2);
			$
					.ajax({
						url : "../../../../all/selectAllUserType",
						dataType : "json",
						data : {
						},
						type : "get",
						success : function(data) {
							layer.close(index);
							console.log(data);
							
							var strJoin="";
							$(data).each(function (index,element){
								strJoin+='<option value="'+element.typeId+'">'+element.typeName+'</option>';
							});
							
							$("#userType").append(strJoin);
						}
					});
			
		}
		

	</script>
</body>
</html>